Jump To:
Technical Q&As
Mac OS X provides programming interfaces that work together to create a seamless visual environment. There are three main technologies: Quartz 2D, the graphics library that leverages the PDF drawing model; a platform-optimized OpenGL stack that handles three-dimensional graphics; and Quartz Extreme, the unique Mac OS X windowing system that brings together 2D and 3D graphics and composites 2D images, 3D images, and video in real time.

Graphics & Imaging Resources
A guided introduction and learning path for developers new to Mac OS X graphics and imaging.  
Document Descriptions
On Off
Display

Sort by
Title
Sorted by
Topic
Sort by
Date
aglChoosePixelFormat, The Inside Scoop (HTML)
OGL01: Describes the nuances of aglChoosePixelFormat, including specific information on multi-monitor support.
Carbon 2000-04-03
CalcCMask and SeedCFill in Carbon (HTML) ()
QD62: Explains how to use CalcCMask and SeedCFill in Carbon even though Carbon doesn't support OpenPort.
Carbon 2000-11-08
CGBitmapContextCreate Supported Color Spaces (HTML)
QA1037: Lists the color space and alpha info combinations currently supported by CGBitmapContextCreate.
Carbon 2004-09-09
CGContext Bounds (HTML)
QA1048: Explains how to determine the bounds of a CGContext.
Carbon 2001-07-02
CGContextAddLineToPoint, CGContextAddCurveToPoint, et. al. (HTML)
QA1049: Explains why the CGContextAddXYZ APIs don't draw anything immediately.
Carbon 2001-07-02
CGContextClosePath (HTML)
QA1046: Explains when you should call CGContextClosePath.
Carbon 2001-10-02
CGImageRef contents are immutable (HTML) ()
QA1276: Explains that CGImageRef contents are considered immutable once created.
Carbon 2003-07-17
Context Sharing Tips (HTML) ()
QA1248: How to correctly share OpenGL contexts and what the limits on this sharing are.
Carbon 2003-06-24
Converting RGB Colors to a Palette Index (HTML)
Deprecated - QD21: Explains how to convert RGB colors into the palette index created by an application.
Carbon 1995-09-15
Correct Setup of an AGLDrawable (HTML)
OGL02: Describes the setup of an AGLDrawable.
Carbon 2000-10-04
Creating Gray Scaled Images > 8 bits (HTML) ()
Deprecated - QD51: Shows how to create gray-scaled images at resolutions greater than 8 bits for display.
Carbon 1997-11-17
Current GDevice Dependencies (HTML) ()
QA1115: Describes potential problems with creating windows or ports when the current GDevice isn't the main device.
Carbon 2002-02-13
DeviceLoop is for drawing (HTML)
QA1024: Warns of one common misuse of the DeviceLoop API and gives two alternative solutions.
Carbon 2001-04-11
Drawing a Path Multiple Times (HTML)
QA1047: Explains that path drawing operations consume the path.
Carbon 2001-07-02
Error -151 and NewGWorld (HTML)
Deprecated - QD18: Explains what the error code -151 means when in NewGWorld.
Carbon 1995-09-15
Finding Missing OpenGL CFM Entry Points (HTML) ()
QA1225: A resolution to Mac OS X 10.2 OpenGL CFM applications which break under Mac OS X 10.1.
Carbon 2002-12-23
Finding the bit depth of a Carbon Printing Manager graphics context (HTML) ()
QD63: Explains how to find the bit depth of a Carbon Printing Manager graphics context.
Carbon 2000-11-08
GetPortBitMapForCopyBits (HTML) ()
Deprecated - QD61: Describes the proper usage of GetPortBitMapForCopyBits.
Carbon 2000-11-08
GetProcAdress and OpenGL Entry Points (HTML) ()
QA1188: Technique for finding function pointers for OpenGL entry points in Cocoa and Carbon
Carbon 2002-11-25
How can I programmatically determine the DPI of the current video mode? (HTML) ()
QA1217: Describes how to compute the DPI for a given display in a given mode using Core Graphics.
Carbon 2002-12-02
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) ()
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Carbon 2002-12-04
How do I use PMSessionGetGraphicsContext to get a CGContextRef? (HTML) ()
QA1216: Describes how to use PMSessionSetDocumentFormatGeneration and PMSessionGetGraphicsContext to get a CGContextRef for printing.
Carbon 2003-02-25
How do I use QuickDraw with CGDirectDisplay? (HTML)
QA1011: Explains how to draw to a CGDirectDisplay-captured display using QuickDraw.
Carbon 2001-04-11
How to measure CG text (HTML)
QA1051: Explains how to measure Core Graphics text.
Carbon 2001-07-02
Incorrect Inside Macintosh Volume V documentation (HTML)
Deprecated - QD15: Identifies incorrect documentation in Inside Macintosh Volume V regarding the formats of PnPixPat and BkPixPat opcodes.
Carbon 1995-09-15
Is ColorSync thread safe? (HTML) ()
QA1261: Discusses ColorSync thread-safety issues.
Carbon 2003-04-17
LockPixels and DisposeGWorld with QTNewGWorldFromPtr (HTML)
QA1007: Clarifies some issues surrounding pointer ownership when creating GWorlds with QTNewGWorldFromPtr
Carbon 2001-02-26
OpenGL Sample Code (HTML)
QA1166: Describes new naming convention for OpenGL sample code
Carbon 2004-12-01
OpenGL Texture Sharing Between Contexts (HTML)
QA1031: Describes the process of creating shared OpenGL contexts and sharing textures between these contexts.
Carbon 2001-05-01
Parsing the PICT File Format (HTML) ()
Deprecated - QD56: Explains where to find information on the PICT file format and warns against parsing a PICT file.
Carbon 1998-02-10
Preserving embedded ICC profiles when using QuickTime Graphics Importer/Exporters (HTML) ()
QA1145: Shows how to preserve the embedded ICC profile when using the QuickTime Graphics Importer/Exporter routines
Carbon 2002-09-04
Problem Getting PICTS to Display in Correct Colors (HTML)
Deprecated - QD24: Using a custom color table to get PICTs to display with the right colors in an offscreen GWorld.
Carbon 1995-09-15
Problem with PaintRgn on 256-color Screens (HTML)
Deprecated - QD23: PaintRgn with RGBForeColor and transfer mode addOver doesn't return color to original on 256-color-screens.
Carbon 1995-09-15
Problems Creating a Mask for a Picture (HTML)
Deprecated - QD27: Demonstrates creating a mask where the mask is 0 for pure white pixels and 1 everywhere else.
Carbon 1995-09-15
Problems recording CopyBits into a PICT on Mac OS X 10.2 (HTML) ()
QA1189: Identifies a problem with CopyBits and PICT on Mac OS X 10.2 and gives a simple workaround.
Carbon 2002-11-19
Providing QuickDraw with a Known Good Port (HTML) ()
Deprecated - QA1237: How to use SetPort( NULL) to provide QuickDraw with a known good port.
Carbon 2003-09-29
QDFlushPortBuffer (HTML) ()
QD65: Describes a possible solution for window update problems under Carbon.
Carbon 2000-11-08
QDSwapPort (HTML) ()
QA1128: Explains when to use QDSwapPort.
Carbon 2002-11-06
Quartz 2D Interpolation (HTML) ()
QA1186: Explains how to control Quartz 2D's image interpolation.
Carbon 2002-10-29
Quartz 2D Thread Safety (HTML) ()
QA1238: Explains the thread-safety issues for the Quartz 2D API.
Carbon 2003-02-25
QuickDraw Text Anti-Aliasing using Quartz 2D (HTML) ()
QA1193: Describes APIs added to Mac OS X to allow applications to draw QD text using CG anti-aliasing.
Carbon 2002-10-29
Replacing OpenPort in Carbon (HTML) ()
QD66: Discusses a potential crashing problem when Carbonizing code that uses black and white GrafPorts.
Carbon 2000-11-08
Saving the current Core Graphics Path (HTML)
QA1056: Explains that the Core Graphics save and restore GState APIs do not affect the path.
Carbon 2001-10-02
Setting the preferred CMM programatically? (HTML)
QA1086: Uses the NCMConcatProfileSet structure to specify the CMM to be used to make the CMWorldRef with the NCWConcatColorWorld function.
Carbon 2001-10-24
Spooling in or out of CompressPicture or CompressImage (HTML)
Deprecated - QD17: Recommends alternatives to spooling the results of CompressPicture or CompressImage to or from disk.
Carbon 1995-09-15
Turning Off Core Graphics Clipping (HTML)
QA1050: Explains how to clear the clipping path for a CGContext.
Carbon 2001-07-02
Unexpected CG state changes (HTML)
QA1045: Explains why the Core Graphics drawing state sometimes changes for no apparent reason.
Carbon 2001-07-02
Updating OpenGL Contexts (HTML) ()
QA1209: When and why to update an OpenGL context in response to system and user actions.
Carbon 2003-06-19
Using Clip Region and Buffer Rectangles with OpenGL Carbon (HTML) ()
QA1222: Shows the basics of using buffer rectangles and clip regions with AGL.
Carbon 2002-12-19
Using qd and QDGlobals (HTML) ()
Deprecated - QD40: Why a sample program compiled with SC may give the link error: undefined entry qd. Provides a solution.
Carbon 1996-02-09
Using Temporary Memory with OpenPicture (HTML)
Deprecated - QD20: Provides several techniques of causing OpenPicture to allocate temporary memory for a picture handle.
Carbon 1996-02-01
Why am I drawing directly to the screen? (HTML)
QA1015: Explains why drawing to a window's backbuffer can affect the upper left corner of the screen instead.
Carbon 2004-02-19
Window Manager and EraseRect (HTML)
Deprecated - QD26: Why WindowManager causes a flicker using EraseRect and provides a solution for this problem.
Carbon 1995-09-15
CGBitmapContextCreate Supported Color Spaces (HTML)
QA1037: Lists the color space and alpha info combinations currently supported by CGBitmapContextCreate.
Cocoa 2004-09-09
CGContextAddLineToPoint, CGContextAddCurveToPoint, et. al. (HTML)
QA1049: Explains why the CGContextAddXYZ APIs don't draw anything immediately.
Cocoa 2001-07-02
CGContextClosePath (HTML)
QA1046: Explains when you should call CGContextClosePath.
Cocoa 2001-10-02
CGImageRef contents are immutable (HTML) ()
QA1276: Explains that CGImageRef contents are considered immutable once created.
Cocoa 2003-07-17
Drawing a Path Multiple Times (HTML)
QA1047: Explains that path drawing operations consume the path.
Cocoa 2001-07-02
Finding an NSView's current magnification. (HTML)
QA1346: How to discover the current magnification (zoom level) of any NSView.
Cocoa 2004-12-13
How can I programmatically determine the DPI of the current video mode? (HTML) ()
QA1217: Describes how to compute the DPI for a given display in a given mode using Core Graphics.
Cocoa 2002-12-02
How do I determine how much VRAM is available on my video card? (HTML)
QA1168: Using Core Graphics and IOKit to find the physical size of VRAM on installed hardware.
Cocoa 2004-10-11
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) ()
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Cocoa 2002-12-04
How to measure CG text (HTML)
QA1051: Explains how to measure Core Graphics text.
Cocoa 2001-07-02
Is ColorSync thread safe? (HTML) ()
QA1261: Discusses ColorSync thread-safety issues.
Cocoa 2003-04-17
NSOpenGLView redraw problems after a window is closed and re-opened. (HTML)
QA1353: Workaround for NSOpenGLView failure to draw after its window is closed and re-opened.
Cocoa 2004-12-03
NSTimers and Rendering Loops (HTML)
QA1385: Using Cocoa timers (NSTimer) to drive a rendering loop
Cocoa 2004-10-04
OpenGL Sample Code (HTML)
QA1166: Describes new naming convention for OpenGL sample code
Cocoa 2004-12-01
Quartz 2D Interpolation (HTML) ()
QA1186: Explains how to control Quartz 2D's image interpolation.
Cocoa 2002-10-29
Quartz 2D Thread Safety (HTML) ()
QA1238: Explains the thread-safety issues for the Quartz 2D API.
Cocoa 2003-02-25
Saving the current Core Graphics Path (HTML)
QA1056: Explains that the Core Graphics save and restore GState APIs do not affect the path.
Cocoa 2001-10-02
Setting the ColorSync profile for a NSBitmapImageRep object (HTML)
QA1369: Setting the ColorSync profile for a NSBitmapImageRep object
Cocoa 2004-09-08
Setting the preferred CMM programatically? (HTML)
QA1086: Uses the NCMConcatProfileSet structure to specify the CMM to be used to make the CMWorldRef with the NCWConcatColorWorld function.
Cocoa 2001-10-24
Shearing a Coordinate Space with NSAffineTransform (HTML) ()
QA1332: Describes a simple way to shear coordinate spaces by adding a few methods to the NSAffineTransform class.
Cocoa 2004-01-29
Turning Off Core Graphics Clipping (HTML)
QA1050: Explains how to clear the clipping path for a CGContext.
Cocoa 2001-07-02
Unexpected CG state changes (HTML)
QA1045: Explains why the Core Graphics drawing state sometimes changes for no apparent reason.
Cocoa 2001-07-02
Using Interface Builder's NSOpenGLView or Custom View objects for an OpenGL application (HTML)
QA1167: Describes usage cases for both NSOpenGLViews and Custom Views for Cocoa OpenGL applications
Cocoa 2004-10-28
ColorSync 2.0 (HTML)
CS02: Explains CMProfileLocation's second argument, where a ColorSync profile is, and the type of a profile location.
ColorSync 1995-05-01
Creating color spaces that ensure color matching. (HTML)
QA1396: How to create color spaces that ensure color matching.
ColorSync 2005-01-13
Embedding ICC Profiles (HTML) ()
CS06: Gives downloads for documents describing embedding ICC profiles in EPS, PICT, and TIFF files.
ColorSync 1996-02-09
Getting the name of a profile (HTML) ()
QA1205: Shows how to programmatically get the name of a ColorSync profile.
ColorSync 2002-10-25
ICC Profile copyright field (HTML) ()
QA1136: Discusses how applications should honor the copyright field in the header of an ICC profile.
ColorSync 2002-04-08
Is ColorSync thread safe? (HTML) ()
QA1261: Discusses ColorSync thread-safety issues.
ColorSync 2003-04-17
Missing ColorSync Profiles (HTML) ()
CS13: Describes ColorSync profiles, focusing on the desc tag of the profile and the results of incorrect tags.
ColorSync 1999-05-03
Setting the ColorSync profile for a NSBitmapImageRep object (HTML)
QA1369: Setting the ColorSync profile for a NSBitmapImageRep object
ColorSync 2004-09-08
Setting the preferred CMM programatically? (HTML)
QA1086: Uses the NCMConcatProfileSet structure to specify the CMM to be used to make the CMWorldRef with the NCWConcatColorWorld function.
ColorSync 2001-10-24
Special Profile Sizes in ColorSync Manager (HTML)
CS03: Answers several questions on special profile sizes in ColorSync Manager and other efficiency issues.
ColorSync 1995-05-01
Successful Call to NCWNewColorWorld (HTML) ()
CS08: Explains the return value of NCWNewColorWorld and the CMWorldRef parameter as a valid return value when successful.
ColorSync 1996-02-09
Using cmPathBased profile locations on Mac OS X (HTML) ()
QA1203: Shows how to correctly specify cmPath-based profile locations on Mac OS X
ColorSync 2002-11-06
Using Embedded EPS Profiles (HTML) ()
CS09: Gives source on embedding ColorSync profiles in EPS as well as PICT and TIFF formats.
ColorSync 1996-02-09
Carbon Full Screen Conundrums (HTML)
QA1068: Describes the available Mac OS X DrawSprocket services.
Games 2001-08-20
CGBitmapContextCreate Supported Color Spaces (HTML)
QA1037: Lists the color space and alpha info combinations currently supported by CGBitmapContextCreate.
Games 2004-09-09
Context Sharing Tips (HTML) ()
QA1248: How to correctly share OpenGL contexts and what the limits on this sharing are.
Games 2003-06-24
Correct Setup of an AGLDrawable (HTML)
OGL02: Describes the setup of an AGLDrawable.
Games 2000-10-04
Current GDevice Dependencies (HTML) ()
QA1115: Describes potential problems with creating windows or ports when the current GDevice isn't the main device.
Games 2002-02-13
Finding Missing OpenGL CFM Entry Points (HTML) ()
QA1225: A resolution to Mac OS X 10.2 OpenGL CFM applications which break under Mac OS X 10.1.
Games 2002-12-23
GetProcAdress and OpenGL Entry Points (HTML) ()
QA1188: Technique for finding function pointers for OpenGL entry points in Cocoa and Carbon
Games 2002-11-25
How can I programmatically determine the DPI of the current video mode? (HTML) ()
QA1217: Describes how to compute the DPI for a given display in a given mode using Core Graphics.
Games 2002-12-02
How do I determine how much VRAM is available on my video card? (HTML)
QA1168: Using Core Graphics and IOKit to find the physical size of VRAM on installed hardware.
Games 2004-10-11
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) ()
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Games 2002-12-04
How do I use QuickDraw with CGDirectDisplay? (HTML)
QA1011: Explains how to draw to a CGDirectDisplay-captured display using QuickDraw.
Games 2001-04-11